package com.hdax.dmw.item.api;

import java.util.Map;

import com.hdax.dmw.dtos.item.ItemDescDto;
import com.hdax.dmw.item.service.DmItemService;
import com.hdax.dmw.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(path = "/desc")
public class ItemDescApi {

    @Autowired
    private DmItemService itemService;
    
    @PostMapping(path = "/getItems")
    public Result<ItemDescDto> getItems(@RequestBody Map<String,Long> params){
        //获取商品id
        Long itemId = params.get("id");
        //查询商品详情
        return itemService.getItems(itemId);
    }
}
